package com.visionet.school.app.web.service.user;

import com.visionet.school.app.web.entity.user.User;
import com.visionet.school.app.web.repository.user.UserRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by hxpeng on 2017/3/9.
 */
@Service
public class UserService {

    @Resource
    private UserRepository userRepository;


    public User login(String userName, String userPwd){
        return userRepository.login(userName,userPwd);
    }

    public User save(User user){
        return userRepository.save(user);
    }

    public User findOneByMemberId(String memberId){return userRepository.findOneByMemberId(memberId);}

    public User findOneByOpenId(String openId){return userRepository.findOneByOpenId(openId);}
}
